<?require_once("connection.php");
//error_reporting(0);
  $query1 = "select post_title, guid from wp_posts order by id desc limit 1;";
  $result1 = mysql_query($query1);
  $row1 = mysql_fetch_array($result1);
  //echo $row1["guid"];
  //echo $row1["post_title"];

  $course_id = $_POST["course_id"];
  $lecture_id = $_POST["lecture_id"];
  //$value = "<a href='".$row1["guid"]."'>".$row1["post_title"]."</a>";
  $query = "update g_lectures set slide='".$row1["post_title"]."', slide_url='".$row1["guid"]."' where lecture_id=".$lecture_id.";";
  $result = mysql_query($query);

  if(empty($result)){
      echo "<pre>The slide has not been UPLOADED!!!</pre>";
  }
  else{
      echo "<pre>The slide has been successfully UPLOADED</pre>";
  }
  require_once("display_lectures.php");
?>
